#pragma once
#include "afxwin.h"

class CQuadPaint;
class CPaintWnd;

// CQPContrlPanel dialog

class CQPContrlPanel : public CDialog
{
	DECLARE_DYNAMIC(CQPContrlPanel)

public:
	CQPContrlPanel(CWnd* pParent = NULL);   // standard constructor
	virtual ~CQPContrlPanel();

	void setPaintWnd(CPaintWnd  * pWnd);
	bool isLocalBrush();
	void EnableRefineButton();

// Dialog Data
	enum { IDD = IDD_QPCONTROL };

private:
	// point to parent, parent->this = NULL, when destroy itself.
	CQuadPaint *m_pParent;
	CPaintWnd  *m_pPaintWnd;       //point to paint window

protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support

	DECLARE_MESSAGE_MAP()
public:
	virtual BOOL OnInitDialog();
protected:
//	virtual BOOL OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult);
	virtual void PostNcDestroy();
	virtual void OnOK();
	virtual void OnCancel();

	// whether local brush is set
	CButton m_buttonLocalBrush;
public:
	afx_msg void OnBnClickedRadLocalBrush();
	afx_msg void OnBnClickedButCpUndo();
	afx_msg void OnBnClickedButSave();
	afx_msg void OnBnClickedButQuadSolver();
protected:
	// local refinement brush
	CButton m_refineBrush;
public:
	afx_msg void OnBnClickedRadLocalRefine();
protected:
	// show result type in Main window
	CComboBox m_showResultType;
public:
	afx_msg void OnCbnSelchangeComShowResultType();
};
